package com.chris.blog.service.impl;

import com.chris.blog.dao.UserInfoDao;
import com.chris.blog.entity.po.UserInfoPO;
import com.chris.blog.service.UserInfoService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
@Transactional
public class UserInfoServiceImpl implements UserInfoService {

    @Resource
    private UserInfoDao userInfoDAO;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int insert(UserInfoPO record) {
        return userInfoDAO.insert(record);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int insertSelective(UserInfoPO record) {
        return userInfoDAO.insertSelective(record);
    }

    public UserInfoPO selectInfoByUid(String uid) {
        return userInfoDAO.selectInfoByUid(uid);
    }

    @Transactional(rollbackFor = Exception.class)
    public void updateByUid(UserInfoPO userInfoPO) {
        userInfoDAO.updateByUid(userInfoPO);
    }
}

